<?php

use kartik\date\DatePicker;
use yii\helpers\Html;
use yii\helpers\ArrayHelper;
use yii\bootstrap\ActiveForm;

/* @var $this yii\web\View */
/* @var $form yii\bootstrap\ActiveForm */
/* @var $model \common\models\LoginForm */

$this->title = '注册';

$fieldOptions1 = [
    'options' => ['class' => 'form-group has-feedback'],
    'inputTemplate' => "{input}<span class='glyphicon glyphicon-envelope form-control-feedback'></span>"
];

$fieldOptions2 = [
    'options' => ['class' => 'form-group has-feedback'],
    'inputTemplate' => "{input}<span class='glyphicon glyphicon-lock form-control-feedback'></span>"
];

$fieldOptions3 = [
    'options' => ['class' => 'form-group has-feedback'],
];
?>

<div class="login-box">
    <div class="login-logo">
        <a href="#"><b>注册</b></a>
    </div>
    <div class="login-box-body">
        <p class="login-box-msg"><b>注册</b></p>
        <?php $form = ActiveForm::begin(['enableClientValidation' => false]); ?>
        <?= $form->field($model, 'username', $fieldOptions1)->label('用户名')->textInput() ?>
        <?= $form->field($model, 'password', $fieldOptions2)->label('密码')->passwordInput() ?>
        <?= $form->field($model, 'role', $fieldOptions3)->label('权限')->dropDownList([
            '普通成员' => '普通成员',
        ], ['prompt' => '权限']) ?>
        <div class="row">
            <div class="col-xs-4">
            </div>
            <div class="col-xs-4">
                <?= Html::submitButton('注册', ['class' => 'btn btn-primary btn-block btn-flat', 'name' => 'sign-up-button']) ?>
            </div>
        </div>
        <?php ActiveForm::end(); ?>
    </div>
</div>
